DEW.RegistrarUsuarioController = function() {
};

$.extend(DEW.RegistrarUsuarioController.prototype, {
    render: function() {
        this.displayPopup();
    },
    displayPopup: function() {        
        var loginPopup = new DEW.PopupWindow({
                        ctClass: 'loginPopup',
                        title: 'Registrar Usuario',
                        needValidation: false,
                        panel: new DEW.RegistrarUsuario({
                            model: new DEW.UsuarioModel()
                        }),
                        buttons: [{
                            id: 'create-btn',
                            name : 'Crear',
                            hidden: false,
                            primary: true,
                            handler: function() {
                                loginPopup.panel.authenticate({
                                    success: function(email) {
                                        loginPopup.panel.hideLoginError();
                                        header.login(email);
                                        loginPopup.close();
                                    }
                                });
                            }
                        }]
                    });
                    loginPopup.render();
                    $("body").append(loginPopup.el);
      }    
});

